-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
cat: Changes to ENOSPC Handling #9933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
I did not know that we have our own error messages instead of extracting from OS. |
|
GNU testsuite comparison: |
|
@mattsu2020 FYI, the "merge branch" just makes review slower ;) |
sorry |
|
GNU testsuite comparison: |
- Introduce WriteError variant in CatError enum to specifically handle stdout write failures - Add map_write_err helper to wrap io::Result into CatResult with WriteError - Update cat_files to catch WriteError early and report using localized message - Wrap write_all and flush calls in write_fast and write_lines with map_write_err - Add localized error messages for "write error" in en-US and fr-FR locales This improves error reporting for I/O issues like broken pipes during output.
…ite_nonprint_to_end Removed a trailing semicolon following the match arms in the `write_nonprint_to_end` function, which was likely causing a compiler warning or style issue in Rust. This ensures cleaner code without altering functionality.
- Adds a new test case to verify that `cat /dev/stdin` properly handles writing to a full device (/dev/full) and outputs the correct error message "No space left on device" without the raw errno code. This improves test coverage for error handling on Unix-like systems.
- Prevents spell-checker from flagging ENOSPC as a misspelling, as it's a valid errno constant (e.g., "No space left on device") used in the test code.
|
GNU testsuite comparison: |
Merging this PR will degrade performance by 27.39%
Performance Changes
Comparing Footnotes
|
Remove the unused import of `uucore::libc` that was only included on non-Windows platforms, simplifying the code and reducing unnecessary dependencies.
To align with GNU coreutils behavior
Changes to ENOSPC handling
related
#9920